Skip to content

feat(ci): promote ci junit-upload from shim to native as a deprecated alias#1468

Closed
jd wants to merge 2 commits into
devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4from
devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c
Closed

feat(ci): promote ci junit-upload from shim to native as a deprecated alias#1468
jd wants to merge 2 commits into
devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4from
devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c

Conversation

@jd
Copy link
Copy Markdown
Member

@jd jd commented May 27, 2026

junit-upload is the deprecated alias for junit-process
Python's mergify_cli/ci/cli.py declares it with click's
deprecated="Use \junit-process` instead"decorator and delegates straight to the sameprocess_junit_filesbody. The shim was still routing it through Python only because the orchestrator wasn't native yet; now that Phase C landed, we can collapse it down to a clap variant that reusesJunitProcessCliArgsand dispatches tomergify_ci::junit_process::runafter printing aDeprecationWarning: …` line to stderr (matches click's behavior
on first invocation).

This retires the last ci shim — prepend_two lost its only
remaining caller and goes with it. stack is now the only
shimmed top-level group left.

Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com

Depends-On: #1467

@jd
Copy link
Copy Markdown
Member Author

jd commented May 27, 2026

This pull request is part of a Mergify stack:

# Pull Request Link
1 refactor(queue): drop indexmap, group_by_scope returns a Vec<(K, V)> #1445
2 refactor(ci): swap uuid for getrandom in the GHA heredoc delimiter #1446
3 refactor(config): standardize the workspace on serde_yaml_ng for YAML parsing #1447
4 test(ci): add live smoke test for ci scopes select-all path #1460
5 feat(rust): port ci scopes to native Rust #1461
6 feat(ci): swap Python's JUnit XML parser for the native Rust parser #1465
7 feat(ci): encode JUnit cases as OTLP and upload to Mergify CI Insights #1466
8 feat(ci): promote ci junit-process from shim to native Rust #1467
9 feat(ci): promote ci junit-upload from shim to native as a deprecated alias #1468 👈

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 27, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 ⛓️ Depends-On Requirements

Waiting for

This rule is failing.

Requirement based on the presence of Depends-On in the body of the pull request

🔴 🤖 Continuous Integration

Waiting for

  • check-success=ci-gate
This rule is failing.
  • all of:
    • check-success=ci-gate

🔴 👀 Review Requirements

Waiting for

  • #approved-reviews-by>=2
This rule is failing.
  • any of:
    • #approved-reviews-by>=2
    • author = dependabot[bot]
    • author = mergify-ci-bot
    • author = renovate[bot]

🔴 🔎 Reviews

Waiting for

  • #review-requested = 0
This rule is failing.
  • #review-requested = 0
  • #changes-requested-reviews-by = 0
  • #review-threads-unresolved = 0

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?:

🟢 📕 PR description

Wonderful, this rule succeeded.
  • body ~= (?ms:.{48,})

@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 8078737 to ed7a74d Compare May 27, 2026 08:27
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch from 57bb83b to bd85763 Compare May 27, 2026 08:27
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:27 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:27 — with GitHub Actions Inactive
@jd
Copy link
Copy Markdown
Member Author

jd commented May 27, 2026

Revision history

# Type Changes Reason Date
1 initial 57bb83b 2026-05-27 08:27 UTC
2 content 57bb83b → bd85763 2026-05-27 08:27 UTC
3 rebase bd85763 → c994e93 (rebase only) 2026-05-27 08:46 UTC
4 content c994e93 → 8460659 2026-05-27 09:00 UTC
5 rebase 8460659 → de0921a (rebase only) 2026-05-27 09:18 UTC
6 rebase de0921a → a823367 (rebase only) 2026-05-27 10:04 UTC
7 rebase a823367 → 7a63271 (rebase only) 2026-05-27 10:15 UTC
8 rebase 3f9ccca → 07fd863 (rebase only) 2026-05-28 08:20 UTC
9 content 07fd863 → 0269117 2026-05-28 09:45 UTC
10 rebase 0269117 → 1ae26ba (rebase only) 2026-05-28 10:21 UTC

@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 27, 2026 08:28 Failure
@mergify mergify Bot requested a review from a team May 27, 2026 08:42
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch from bd85763 to c994e93 Compare May 27, 2026 08:46
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from ed7a74d to 6eeb3d9 Compare May 27, 2026 08:46
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:46 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 08:46 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 10:15 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 10:15 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 27, 2026 10:15 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 27, 2026 10:15 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from e5b9480 to 5474036 Compare May 28, 2026 07:44
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch from 7a63271 to 3f9ccca Compare May 28, 2026 07:44
@jd jd temporarily deployed to func-tests-live May 28, 2026 07:44 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 07:44 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 07:45 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 5474036 to 70d22a9 Compare May 28, 2026 08:20
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch from 3f9ccca to 07fd863 Compare May 28, 2026 08:20
@jd jd temporarily deployed to func-tests-live May 28, 2026 08:20 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 08:20 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 08:20 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 08:21 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 70d22a9 to ee35991 Compare May 28, 2026 09:45
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch from 07fd863 to 0269117 Compare May 28, 2026 09:45
@jd jd temporarily deployed to func-tests-live May 28, 2026 09:45 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 09:45 Failure
jd and others added 2 commits May 28, 2026 12:20
Third and final layer of the port: the orchestration that wires
the JUnit parser, OTLP encoder, uploader, and a new quarantine
API client together, plus the native clap dispatch that retires
the Python shim for this subcommand.

Two new modules under `junit_process`:

- `quarantine` POSTs failing test names to
  `/v1/ci/<owner>/repositories/<repo>/quarantines/check` and
  splits the response into quarantined / non-quarantined buckets.
  The categorize step counts unknown names as non-quarantined to
  match Python (an API that silently drops a name still blocks
  the corresponding failure).

- `command::run` orchestrates the per-invocation flow: resolve
  the token / repo / target branch (falling back to the CI-env
  detector for the latter two), expand `**`/`*`/`?` patterns into
  paths, parse every file, hit the quarantine endpoint, feed the
  quarantined set into the OTLP builder so each case span gets
  the right `cicd.test.quarantined` value at build time, upload
  the gzipped protobuf, and render the report. Network failures
  on quarantine or upload are non-fatal — the report calls them
  out and the verdict still fires based on
  `failing_tests_not_quarantined_count`.

The dispatch layer in `main.rs` promotes
`Subcommands::Ci(CiSubcommand::JunitProcess)` from
`ShimmedArgs` to a full clap variant, adds the
`("ci", "junit-process")` entry to `NATIVE_COMMANDS`, and routes
through `mergify_ci::junit_process::run`. `ci junit-upload`
(deprecated) keeps its shim.

The detector gains `get_tests_target_branch` (base ref OR head
ref) so the orchestrator can derive the branch the quarantine API
should look up tests on without round-tripping through Python.

Output is byte-for-byte the same as the Python implementation's
`process_junit_files` — same separators, same emoji, same
`Run ID`/`Exit code` lines, same `┌ … │ … └─` box-drawn failure
blocks. End-to-end smoke against the live `junit_fail.xml`
fixture exits 1 on a non-quarantined failure and 0 on an
all-pass run, matching Python's contract.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: I6bd59de407ddcd4196bdd7e7b8ddb4a88885af7a
…ed alias

`junit-upload` is the deprecated alias for `junit-process` —
Python's `mergify_cli/ci/cli.py` declares it with click's
`deprecated="Use \`junit-process\` instead"` decorator and
delegates straight to the same `process_junit_files` body. The
shim was still routing it through Python only because the
orchestrator wasn't native yet; now that Phase C landed, we can
collapse it down to a clap variant that reuses
`JunitProcessCliArgs` and dispatches to
`mergify_ci::junit_process::run` after printing a
`DeprecationWarning: …` line to stderr (matches click's behavior
on first invocation).

This retires the last `ci` shim — `prepend_two` lost its only
remaining caller and goes with it. `stack` is now the only
shimmed top-level group left.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Change-Id: Ic316f55c5d8a834cefa5d30ffbf5ebabec0a4122
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from ee35991 to 951ac81 Compare May 28, 2026 10:21
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch from 0269117 to 1ae26ba Compare May 28, 2026 10:21
@jd jd temporarily deployed to func-tests-live May 28, 2026 10:21 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 10:21 — with GitHub Actions Inactive
@jd jd temporarily deployed to func-tests-live May 28, 2026 10:21 — with GitHub Actions Inactive
@mergify mergify Bot had a problem deploying to Mergify Merge Protections May 28, 2026 10:21 Failure
@jd jd force-pushed the devs/jd/worktree-rust-port/promote-ci-junit-process-shim-native-rust--6bd59de4 branch from 951ac81 to dce251a Compare May 28, 2026 11:40
@jd jd closed this May 28, 2026
@jd jd deleted the devs/jd/worktree-rust-port/promote-ci-junit-upload-shim-native-deprecated--c316f55c branch May 28, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant